There are many things you can do to protect yourself from being the victim of a pickpocket before it happens, but it's hard to get your money back after the fact, when it's already happened.
The phrase after the fact is often used in legal contexts to refer to the time after a crime has already taken place. The "fact" is a specific act, or crime. Someone described as "an accessory after the fact" is someone who helped a criminal get away with a crime that he or she has already committed, such as by helping the person hide or escape. That in itself is a crime.